<?php
/**
 * Framework_Component_Common
 *
 * @author      Ian Szewczyk <roamzero@gmail.com>
 * @copyright   (c) 2007 Ian Szewczyk. All rights reserved.
 * @license     http://www.opensource.org/licenses/bsd-license.php
 * @package Framework
 * @subpackage Component
 * @filesource
 */

/**
 * Framework_Component_Common
 *
 * Base class which all components should extend from
 *
 * @author 		Ian Szewczyk <roamzero@gmail.com>
 * @package 	Framework
 * @subpackage 	Component
 */

abstract class Framework_Component_Common extends Framework_Object_Web
{
	/**
	 * run
	 *
	 * @access      public
	 * @return      mixed
	 * @abstract
	 */
	abstract public function run();

	/**
	 * $data
	 *
	 * @access 		protected
	 * @var 		array 		$name 		Array of data for the component
	 */
	protected $data;
	
	/**
	 * $params
	 *
	 * @access 		protected
	 * @var 		array 		$params 	Array of parameters for the component
	 */
	protected $params;
	
	/**
	 * $tplFile
	 *
	 * @access 		public
	 * @var 		string		$tplFile 	Template file to use for rendering
	 */
	public $tplFile;
	
	
	public $folder = 'Framework';
	
	/**
	 * $forms
	 *
	 * @access 		public
	 * @var 		array		$forms 		Array of QuickForm objects to be rendered
	 */
	public $forms = array();
	
	/**
     * __construct
     *
     * Initializes the components parameters
     *
     * @access 		public
     * @return 		void
     */
	public function __construct($params = null)
	{
		$this->params = $params;
		parent::__construct();
	}


	/**
	 * setData
	 *
	 *
	 * @access 		public
	 * @param		string 		$var 		Name of variable
	 * @param 		mixed 		$val 		Value of variable
	 * @return 		void
	 */
	public function setData($var,$val) {
		$this->data[$var] = $val;
	}
	
    /**
     * getData
     *
     * Returns components's data. 
     *
     * @return 		mixed
     */
    public function getData()
    {
        return $this->data;
    }


}




?>